package com.lbj.core.ext

import android.app.Activity
import android.content.Intent
import com.lbj.core.R

/**
 * 作者：李炳军
 * 创建日期：2021-03-31  17:04
 * 释义：
 */
fun Activity.pageAnim() {
    overridePendingTransition(R.anim.page_in_right, R.anim.page_out_left)
}

fun Activity.finishPageAnim() {
    finish()
    overridePendingTransition(R.anim.page_in_left, R.anim.page_out_right)
}

fun Activity.startPage(toClass: Class<*>?) {
    if(toClass != null){
        startActivity(Intent(this, toClass))
        pageAnim()
    }
}